﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Waker.BAL
{
    public class BAL_Base
    {
        public DataTable GetTableByTableName(string tableName)
        {
            if (string.IsNullOrEmpty(tableName))
                return null;
            var strSql = string.Format("SELECT * FROM {0}", tableName);
            var dt = new DAL.DAL_SystemSetting().GetTableBySql(strSql);
            dt.TableName = tableName;
            return dt;
        }
        public bool UpdateTable(DataTable dt)
        {
            return new DAL.DAL_SystemSetting().UpdateDataTable(dt) >= 0;
        }
        public int GetNextId(string tableName, string colName)
        {
            return new DAL.DAL_SystemSetting().GetNextId(tableName, colName);
        }
    }
}
